/**
 * @file displayfrm.h
 * @brief 
 *
 * 
 *
 * @author 1823419256@qq.com
 * @version 1.0
 * @date 2011
*/

#ifndef MYBOOK_DISPLAY_DISPLAYFRM_H_
#define MYBOOK_DISPLAY_DISPLAYFRM_H_

#include "frmskinmixin.h"
#include "ctrls/sizingborder.h"
#include "displaymdi.h"
#include "displaytabctrl.h"

class CDisplayFrame
	: public CWindowImpl<CDisplayFrame, CWindow, CFrameWinTraits>
	, public CFrameSkinMixIn<CDisplayFrame>
	, public CSizingBorder<CDisplayFrame>
{
public:
	DECLARE_FRAME_WND_CLASS(_T("MyDisplayFrame"), IDR_MAINFRAME);

	CDisplayFrame();

	void OnFinalMessage(HWND hWnd);

public:
	BEGIN_MSG_MAP(CDisplayFrame)
		CHAIN_MSG_MAP(CSizingBorder<CDisplayFrame>)
		CHAIN_MSG_MAP(CFrameSkinMixIn<CDisplayFrame>)
		MESSAGE_HANDLER(WM_CREATE, OnCreate)
		MESSAGE_HANDLER(WM_CLOSE, OnClose)
		MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
		MESSAGE_HANDLER(WM_SIZE, OnSize)
		MESSAGE_HANDLER(WM_GETMINMAXINFO, OnGetMinMaxInfo)
		MESSAGE_HANDLER(WM_COPYDATA, OnCopyData)
		REFLECT_NOTIFICATIONS()
	END_MSG_MAP()

// Handler prototypes (uncomment arguments if needed):
//	LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
//	LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
//	LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)

	LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnGetMinMaxInfo(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnCopyData(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);

public:
	bool Navigate(LPCTSTR lpszUrl);
	
public:
	void SetMediator(CDisplayMediator*) {} 

protected:
	CDisplayMediator m_Mediator;
	CDisplayMdi m_MdiClient;
	CDisplayTabCtrl m_TabCtrl;
};

#endif // MYBOOK_DISPLAY_DISPLAYFRM_H_